<?php
$tourbest = db_get_list_post_in_post_type_nopage_metakey(5, 'news-event', 'date', 'DESC', $wpdb->prefix.'display', 'display');
query_posts($tourbest); 
?>
<div class="box-news">
           	<div class="left">
           	<?php
           	if(have_posts())
           	{
           		$j=1;
           		$image_rs = new  SimpleImage();
           		while (have_posts())
           		{
           			the_post();
           			$postID = get_the_ID();
					$title = get_the_title($postID);
					$perlink = get_permalink($postID);
					$alt = db_vietnamese_slug($title);
					$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
					if($thumbnail)
						$thumbnail = db_resizeImage($image_rs, $thumbnail, 90, 71);
					if($j==1)
					{	
           			?>
           			<div class="big-news">
	                	<div class="box-img">
	                    	<img alt="<?php echo $alt;?>" src="<?php echo $thumbnail;?>" />
	                    </div>
	                    <div class="box-info">
	                    	<a href="<?php echo $perlink;?>" class="name" title="<?php echo $title;?>"><?php echo db_shortDesc($title, 45);?></a>
	                        <p><?php echo db_shortDesc(get_the_content(), 110);?></p>
	                        <a href="<?php echo $perlink;?>" class="details" title="<?php echo $title;?>">Details</a>
	                    </div>
	                </div>
	                <div class="others-news">
                		<ul>
           			<?php
					}
					else 
					{
					?>
						<li>
                        	<a href="<?php echo $perlink;?>" title="<?php echo $title;?>"><?php echo db_shortDesc($title,57);?> </a><span><?php echo get_the_date('Y/m/d');?></span>
                        </li>
					<?php 	
					}
           			$j++; 
           		}
           		?>
	           			</ul>
	                </div>
           		<?php 
           		wp_reset_query();
           		unset($image_rs);
           	} 
           	else 
           	{
           		echo 'No Post!.';
           	}
           	?>           
                
            </div>
            
            <div class="right">
            <?php
			$touradv = db_get_list_post_in_post_type_nopage_metakey(1, 'adv', 'date', 'DESC', $wpdb->prefix.'adv_news', 'display');
			query_posts($touradv);
			if(have_posts())
			{
				the_post();
				$postID = get_the_ID();
				$title = get_the_title();
				$alt = db_vietnamese_slug($title);
				$perlink = get_post_meta($postID, $wpdb->prefix.'url',true);
				if(!$perlink)
					$perlink = get_permalink();
				$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
				?>
				 	<a href="<?php echo $perlink;?>" title="<?php echo $title;?>"><img alt="<?php echo $alt;?>" src="<?php echo $thumbnail;?>" /></a>
				<?php 	
			} 
			?>           
            </div>
           </div>